package com.study;

import javax.swing.*;

public class ShowDataTime {
    public static void main(String[] args) {
        JFrame jf = new JFrame();
        jf.setSize(400,300);
        jf.setLayout(null);
        jf.setDefaultCloseOperation(3);
        jf.setLocationRelativeTo(null);
        jf.setTitle("手机日期和时间显示");
        jf.setAlwaysOnTop(true);

        // 提示日期
        JLabel dataLabel = new JLabel("日期");
        dataLabel.setBounds(50,50,100,20);
        jf.add(dataLabel);

        // 按照格式显示日期的字符串
        JLabel showDataLabel = new JLabel("xxxx年xxx月xx日");
        showDataLabel.setBounds(50,80,200,20);
        jf.add(showDataLabel);

        // 提示时间
        JLabel timeLabel = new JLabel("时间");
        timeLabel.setBounds(50,150,100,20);
        jf.add(timeLabel);

        // 按照格式显示时间的字符串
        JLabel showTimeLabel = new JLabel("xx:xx");
        showTimeLabel.setBounds(50,180,200,20);
        jf.add(showTimeLabel);

        jf.setVisible(true);
    }
}
